package sg.edu.nus.iss.cerberus.elements;

import java.util.Collection;
import java.util.Set;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import sg.edu.nus.iss.cerberus.wizard.NewTestCaseWizard;

/**
 * ClassTypeFacade offers easy access to a simple java file within eclipse. The
 * file represented by this instance is not a testcase.
 * 
 * @link #isNewTestClassCreated()}
 * 
 */
public class ClassTypeFacade extends TypeFacade {

	public ClassTypeFacade(ICompilationUnit compilationUnit) {
		super(compilationUnit);

	}

	/**
	 * Returns the corresponding testcase of the javaFileFacade. If there are
	 * more than one testcases the user has to make a choice via a dialog. If no
	 * test is found <code>null</code> is returned.
	 * 
	 * @return one of the corresponding testcases
	 */
	public IType getOneCorrespondingTestCase(boolean createIfNecessary,
			String promptText) {

		IType testcaseToJump = null;

		if (createIfNecessary) {
			testcaseToJump = new NewTestCaseWizard(getType()).open();

		}

		return testcaseToJump;
	}

	public IType getOneCorrespondingTestCase(boolean createIfNecessary) {
		return getOneCorrespondingTestCase(createIfNecessary,
				"Please choose a test case...");
	}

	@Override
	protected Collection<IMethod> getCorrespondingMethodsInClasses(
			IMethod method, Set<IType> classes) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected Set<IType> getCorrespondingClasses() {
		// TODO Auto-generated method stub
		return null;
	}

}
